xmlNodePaths

 

 

 

Selection of node(s) to be

·signed or

·encrypted

within XML document(s).

 

The following example demonstrates how to use this parameter for marking (signing) respective XML tags in 2 XML documents (in bold). In this case the only possibility is to create the Enveloping signature type where <Object> tag wraps around every document. Now a user/developer should encounter the wrapping <Object> tag, when setting the properties of this parameter.

 

Document 1 within <Object> tag:

<Object>

  <price-list>

    <coffee>

      <coffee-name> Arabica </coffee-name>

      <price> 4.50 </price>

    </coffee>

    <coffee>

      <coffee-name> HouseBlend </coffee-name>

      <price> 5.00 </price>

    </coffee>

    <coffee>

      <coffee-name> Espresso </coffee-name>

      <price> 5.00 </price>

    </coffee>

    <coffee>

      <coffee-name> Dorada </coffee-name>

      <price> 6.00 </price>

    </coffee>

  </price-list>

</Object>

 

Document 2 within <Object> tag:

<Object>

  <note>

    <to>Tove</to> 

    <from>Jani</from>

    <heading>Reminder</heading> 

    <body>Don't forget me this weekend!</body>

  </note>

</Object>

 

In order to sign the bold parts of two documents the following string must be provided:

“0;0;X;0;1;1;X;@0;0;X;0;2;X;@”

 

The “X” sign denotes the termination of each chosen tag; the “@” sign as a standalone denotes termination of a string. The “tag counting” starts from the first child of document's root tag (in this case with tags <price-list> and <note>, respectively) with “0”. The “;” sign denotes separation between counted tags. “@0” part in bold string denotes the termination of the first document and the start of the next one.

 

In another example, if one wants to sign the root tags of both files previous example refers to (<Object> tags of both documents) the required string for xmlNodePaths would be

“X;@X;@”

In case of signing the root tag(s) there are no tag numbers. proXSign®11.exe GUI displays the value of xmlNodePaths parameter for every desired combination for single or multiple document(s)/tag(s), XML and/or non-XML.

 

NOTE: This parameter value must always be set when signing a single/several XML document(s), or just part(s) of it/them, except in case where detached signature is created (SIG_TYPE_DETACHED) where signature is separated from the document(s) being signed. In this case, when using proXSign® as DLL, this parameter should be set to NULL (nil for Delphi). Also, this parameter is mandatory in encryption process.

With enabled XSIGN_OPTION_SIGN_BY_ID, the list of xml nodes can be signed using their Ids. In this case xmlNodePaths parameter must not be empty and parameter URIId must contain a list of values of selected Ids, separated with semicolon. Those Ids have to exist in the xml that is to be signed. Note that the name of “Id” attribute must use capital letter I and small d.